<?php 
include_once('connection/connection.php');
//session_start();
//ob_start();
include('header.php');
include('menu.php');
include('config.php');
$rows_num = $_SESSION['rows_num'];
$arrHabSource_pump = $_SESSION['arrSource_pump'];
$sum_pump = $_SESSION['totalsum_pump'];
$loc_id = $_SESSION['loc_id'];
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="js/validate.js"></script>
<script language="Javascript" type="text/javascript" src="js/ajaxFunction1_q1.js"></script>
<title>UFW Form</title>
</head>
<body>
<?php
if(isset($_POST['submit']))
{
		$fclick = true;
		$i=1;
		foreach($arrHabSource_pump as $key=>$val)
		{
			for($j=1; $j<=$val; $j++)
			{
				$src_vill='src_vill'.$i;
				$type_src='type_src'.$i;
				$elevation='elevation'.$i;
				$north='north'.$i;
				$east='east'.$i;
				$src_status='src_status'.$i;
				$gw_depth='gw_depth'.$i;
				$gw_level='gw_level'.$i;
				$ph='ph'.$i;
				$tds='tds'.$i;
				$fl='fl'.$i;
				$no='no'.$i;
				$cl='cl'.$i;
				$num_pump='num_pump'.$i;
				
				echo $src_vill=$_POST[$src_vill]; echo "<br>";
				echo $type_src=$_POST[$type_src]; echo "<br>";
				echo $elevation=$_POST[$elevation]; echo "<br>";
				echo $north=$_POST[$north]; echo "<br>";
				echo $east=$_POST[$east]; echo "<br>";
				echo $src_status=$_POST[$src_status];
				echo $gw_depth=$_POST[$gw_depth];
				echo $gw_level=$_POST[$gw_level];
				echo $ph=$_POST[$ph];
				echo $tds=$_POST[$tds];
				echo $fl=$_POST[$fl];
				echo $no=$_POST[$no];
				echo $cl=$_POST[$cl];
				echo $num_pump=$_POST[$num_pump];
				
				//print_r ($count_pump[$i] = $num_pump);
				echo $qr1="INSERT INTO tbl_dtls_ufw_pump_detail(loc_id, src_village, type_src, elevation, north, east, src_status, depth_gw, gw_fluctuation, ph, tds, fl, no3, cl, num_pump) VALUES ('$loc_id', '$src_vill', '$type_src', '$elevation', '$north', '$east', '$src_status', '$gw_depth', '$gw_level', '$ph', '$tds', '$fl', '$no', '$cl', '$num_pump')"; 
				//echo $qr1;
				$result1=mysql_query($qr1);
				//$i++;
				if($num_pump > 0 || $num_pump != '')
				{
					for($k=1; $k<=$num_pump; $k++)
					{
						echo $type_pump='type_pump'. '-' .$k. '-' .$i;
						echo $pump_cap='pump_cap'. '-' .$k. '-' .$i;
						echo $pump_discharge='pump_discharge'. '-' .$k. '-' .$i;
						echo $pump_head='pump_head'. '-' .$k. '-' .$i;
						echo $pump_depth='pump_depth'. '-' .$k. '-' .$i;
						echo $status_pump='status_pump'. '-' .$k. '-' .$i;
						echo $pump_cap_cons='pump_cap_cons'. '-' .$k. '-' .$i;
						echo $discharge_cons='discharge_cons'. '-' .$k. '-' .$i;
						echo $num_hrs='num_hrs'. '-' .$k. '-' .$i;
						echo $current='current'. '-' .$k. '-' .$i;
						echo $voltage='voltage'. '-' .$k. '-' .$i;
						echo $power_factor='power_factor'. '-' .$k. '-' .$i;
						echo $kw_unit='kw_unit'. '-' .$k. '-' .$i;
						
						$type_pump=$_POST[$type_pump];
						$pump_cap=$_POST[$pump_cap];
						$pump_discharge=$_POST[$pump_discharge];
						$pump_head=$_POST[$pump_head];
						$pump_depth=$_POST[$pump_depth];
						$status_pump=$_POST[$status_pump];
						$pump_cap_cons=$_POST[$pump_cap_cons];
						$discharge_cons=$_POST[$discharge_cons];
						$num_hrs=$_POST[$num_hrs];
						$current=$_POST[$current];
						$voltage=$_POST[$voltage];
						$power_factor=$_POST[$power_factor];
						$kw_unit=$_POST[$kw_unit];
						
						echo $qr2="INSERT INTO tbl_dtls_ufw_inner_pump_detail(loc_id, src_village, type_src, pump_type, pump_cap, discharge, head, depth_pump, status_pump, actual_pump_cap, actual_discharge, num_hrs, current, voltage, power_factor, power_cost) VALUES ('$loc_id', '$src_vill', '$type_src', '$type_pump', '$pump_cap', '$pump_discharge', '$pump_head', '$pump_depth', '$status_pump', '$pump_cap_cons', '$discharge_cons', '$num_hrs', '$current', '$voltage', '$power_factor', '$kw_unit')"; 
						$result2=mysql_query($qr2);
					}	
						//$i++;			
						if($result2)
						{
							//echo "success2";
							$relocatePage=true;	
						}
						else 
						{
							$errorIns="Error inserting inner_pump_detail table <br>";
						}
						if($errorIns==0) 
						{
							$relocatePage=true;	
						}
						else 
						{ 
							echo $errorIns;exit;
						}
					}
					$i++;
				}
			}		
			if($result1)
			{
				//echo "success2";
				//$relocatePage=true;	
				header('Location: ufw_4.php');
			}
			else 
			{
				$errorIns="Error inserting pump_detail table <br>";
			}	
}		
else
{
	$fclick = false;
	$flag=0;
}		
?>
<div align="center" style="width:600px;">
<form action="" method="post" enctype="multipart/form-data" name="ufw_3" id="ufw_3" onSubmit="return ufw3()">
	<table border="0" width="1200" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td height="16">
			<p align="center">
			<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">
		  UFW</font></p></td>
		</tr>
		<tr>
			<td height="14">
			<p align="center">
		  <font style="font-size: 8.5pt" face="Arial" color="#000000">Page 3 </font></p></td>
		</tr>
		
		<tr>
			<td bgcolor="#C5D8EB" height="30"><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">&nbsp;&nbsp;Detail of Pumps (As existing in Main Village and Other habitations)</font></span></td>
		</tr>
		<tr>
			<td>
			<table border="0" width="100%" id="table4" cellspacing="1" cellpadding="0" bgcolor="#FDF9EE">
				<tr>
					<td colspan="26"><span style="font-size: 4pt">&nbsp;</span></td>
				</tr>
				<tr>
				<td bgcolor="#F7E6B7" align="center" width="145" rowspan="2">
		  			  <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Source Village Name</font></td>
				<td bgcolor="#F7E6B7" align="center" width="145" rowspan="2">
		  			  <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Type of Source</font></td>
					  <td height="22" colspan="3" rowspan="0" align="center" bgcolor="#F7E6B7">
	  			  <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Source location</font></td>
				      <td align="center" bgcolor="#F7E6B7" rowspan="2" width="84">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Status of Source</font></td>
							<td align="center" width="84" bgcolor="#F7E6B7" rowspan="2">
							<font face="Verdana" style="font-size: 8.5pt" color="#990000">
							Depth of GW (m)</font></td>
							<td align="center" width="77" bgcolor="#F7E6B7" rowspan="2">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							GW level fluctuation (m)</font></td>
							<td align="center" bgcolor="#F7E6B7" rowspan="0" colspan="5">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Parameter Detail of Source Water </font></td>
							<td align="center" width="70" bgcolor="#F7E6B7" rowspan="2">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							No. of Pumps(Nos.)</font></td>
				</tr>	  
				<tr>
							<td align="center" width="78" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Elevation (m)</font></td>
							<td align="center" width="77" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							North</font></td>
							<td align="center" width="75" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							East</font></td>
							<td align="center" width="70" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							pH(mg/l)</font></td>
							<td align="center" width="70" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							TDS(mg/l)</font></td>
							<td align="center" width="70" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Fluoride(mg/l)</font></td>
							<td align="center" width="70" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Nitrate(mg/l)</font></td>
							<td align="center" width="70" bgcolor="#F7E6B7">
							<font style="font-size: 8.5pt" face="Verdana" color="#990000">
							Chloride(mg/l)</font></td>
			  </tr>
			  <?php
						$qr="Select * from tbl_dtls_ufw_pump_num where loc_id='$loc_id'";
						$result=mysql_query($qr);
						$i=0;
						while($row=mysql_fetch_array($result))
						{
						$src_village = $row['src_village'];
						$tw = $row['tw'];
						$ow = $row['ow'];
						$dcb = $row['dcb'];
						$dam = $row['dam'];
						$canal = $row['canal'];
						$other = $row['other'];
						$total+= $tw + $ow + $dcb + $dam + $canal + $other;
						//$_SESSION['total_pump']=$total;
						if($tw >0)
						{
							for($j=1; $j<=$tw; $j++)
							{ 
								 $i+=1;
							?>
				<tr align="center">
				<td width="145" align="center">
				<input type="hidden" name="pump_count" id="pump_count" value="<?php echo $sum_pump;?>" />
				  <input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'TW'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>
				</tr>
			  <tr>
			  <td></td>
			  <td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td>
			  </tr>
			  <?php 
					}
					}
					if($ow >0)
						{
							for($j=1; $j<=$ow; $j++)
							{ 
							$i+=1;
							?>
			  <tr align="center">
				<td width="145" align="center"><input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'OW'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>					
			  </tr>
			  <tr><td></td>
			  <td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td></tr>
			  <?php 
					}
					}
					if($dcb >0)
						{
							for($j=1; $j<=$dcb; $j++)
							{ 
							$i+=1;
							?>
			<tr align="center">
				<td width="145" align="center">
				  <input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'DCB'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>					
			  </tr>
			  <tr><td></td>
			  <td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td></tr>
			  <?php 
					}
					}
					if($dam >0)
						{
							for($j=1; $j<=$dam; $j++)
							{ 
							$i+=1;
							?>
			<tr align="center">
				<td width="145" align="center">
				  <input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'Dam'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>					
			  </tr>
			  <tr><td></td>
			  <td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td></tr>
			  <?php 
					}
					}
					if($canal >0)
						{
							for($j=1; $j<=$canal; $j++)
							{ 
							$i+=1;
							?>
			<tr align="center">
				<td width="145" align="center">
				  <input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'Canal'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>					
			  </tr>
			  <tr><td></td>
			  <td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td></tr>
			  <?php 
					}
					}
					if($other >0)
						{
							for($j=1; $j<=$other; $j++)
							{ 
							$i+=1;
							?>
			<tr align="center">
				<td width="145" align="center">
				  <input type="text" name="src_vill<?php echo $i;?>" id="src_vill<?php echo $i;?>" value="<?php echo $src_village; ?>" size="20" class="txt4" readonly/></td>
				<td width="145" align="center">
				  <input type="text" name="type_src<?php echo $i;?>" id="type_src<?php echo $i;?>" value="<?php echo 'Other'.$j; ?>" size="20" class="txt4" readonly/></td>
				  <td width="78"><input type="text" name="elevation<?php echo $i;?>" id="elevation<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				<td width="77"><input type="text" name="north<?php echo $i;?>" id="north<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,20,32)"></td>
				<td width="75"><input type="text" name="east<?php echo $i;?>" id="east<?php echo $i;?>" size="20" class="txt5" onBlur="float1(this,70,80)"></td>
				<td width="84"><font style="font-size: 8.5pt" face="Arial" color="#000000">
					  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="F" checked="checked" onClick="setEnableufw(this.value,<?php echo $i;?>)">F
	  			  <input type="radio" name="src_status<?php echo $i;?>" id="src_status<?php echo $i;?>" value="NF" onClick="setReadOnlyufw(this.value,<?php echo $i;?>)">NF</font></td>
				  <td width="84"><input type="text" name="gw_depth<?php echo $i;?>" id="gw_depth<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>
				  <td width="77"><input type="text" name="gw_level<?php echo $i;?>" id="gw_level<?php echo $i;?>" size="20" class="txt5" onBlur="float2dec(this)"></td>		
				  <td width="70"><input type="text" name="ph<?php echo $i;?>" id="ph<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,6,10)"></td>
				  <td width="70"><input type="text" name="tds<?php echo $i;?>" id="tds<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,100,40000)"></td>
				  <td width="70"><input type="text" name="fl<?php echo $i;?>" id="fl<?php echo $i;?>" size="20" class="txt5" onBlur="check1(this,0,18)"></td>
				  <td width="70"><input type="text" name="no<?php echo $i;?>" id="no<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,0,2500)"></td>
				  <td width="70"><input type="text" name="cl<?php echo $i;?>" id="cl<?php echo $i;?>" size="20" class="txt5" onBlur="check(this,50,15000)"></td>	
				  <td width="70"><input type="text" name="num_pump<?php echo $i;?>" id="num_pump<?php echo $i;?>" size="20" class="txt5" onKeyUp="show_pump_detail(<?php echo $i;?>);numeric(this)"></td>					
			  </tr>
			  <tr>
			  	<td></td>
			  	<td colspan="14"><div id="pump_detail<?php echo $i;?>"></div></td>
			 </tr>
			  <?php 
					}
					}
				}
				?>
			  </table>		  </td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		
		
		<tr>
			<td align="center">
				<input type="submit" value="Click for Continue" name="submit" style="font-family: Verdana;"></td>
		</tr>
</table>
</form>
</div>		
</body>
</html>
